//下拉
$('.logoWarp .scarchBox .searchTxt').click(function(){
				   $(this).find('.showList').css({'display':'block'});
			   },function(){
				   $(this).find('.showList').css({'display':'none'});
			})
swiper($("#mycaidan1"), "click");
swiper($("#mycaidan2"), "click");
swiper($("#mycaidan3"), "click");
swiper($("#mycaidan4"), "click");
	function swiper(element, event) {
		    var flag = true;
		    element.bind(event, function() {
		        if (flag == true) {
		            $(this).next().slideDown();
		            flag = !flag;
		        } else {
		            $(this).next().slideUp();
		            flag = !flag;
		        }
		    });
		};
//全选  
var aCheck = $(".listNav .list_item_box ul li label>input");
$("#checked1").click(function() {
    for (var i = 0; i < aCheck.length; i++) {
        aCheck[i].checked = true;
    }
});
//全不选
$("#checked2").click(function() {
    for (var i = 0; i < aCheck.length; i++) {
        aCheck[i].checked = !aCheck[i].checked;
    }
});
//反选
$("#checked3").click(function() {
    for (var i = 0; i < aCheck.length; i++) {
        aCheck[i].checked = false;
    }
});
//   点击切换
$('.tab_title li').click(function(){
				$('.tab_title li div').removeClass('active');
				$(this).find('div').addClass('active');
				$('.item').removeClass('show');
				$('.item').eq($(this).index()).addClass('show');
		})
//active 添加
tabEvevt2($("#videozongyi li"), $(".videoTabLeft"), "click");
tabEvevt2($("#comTitle_tabsTab li"), $("#tabsTab>div"), "click");
tabEvevt2($("#dayTab a"), $("#tabsToggle>div"), "click");
tabEvevt2($("#comTitle_tabsTabNba li"), $("#comTitle_tabsToggleTab>.tabs"), "click");
tabEvevt2($("#comTitle_tabs_car_tab li"), $("#comTitle_tabs_car_toggle>.tabs_item"), "click");
tabEvevt2($("#taobao_nbTab a"), $("#taobaoImgToggle>li"), "mouseenter");
tabEvevt2($("#comTitle_tabs_yele_tab li"), $("#comTitle_tabs_yele_toggle>.tabs_item"), "click");
tabEvevt2($("#comTitle_tabs_caijing_tab li"), $("#comTitle_tabs_caijing_toggle>.tabs_item"), "click");
tabEvevt2($("#comTitle_tabs_kantu_tab li"), $("#comTitle_tabs_kantu_toggle>.tabs_item"), "click");
tabEvevt2($("#dushu_tab li"), $("#dushu_toggle>.tabs_item"), "click");
tabEvevt2($("#keji_tab li"), $("#keji_toggle>.tabs_item"), "click");
tabEvevt2($("#game_tab span"), $("#game_toggle>.tabs_item"), "click");
tabEvevt2($("#shouji_tab li"), $("#shouji_toggle>.tabs_item"), "click");
tabEvevt2($("#yingyong_tab span"), $("#yingyong_toggle>.tabs_item"), "click");

function tabEvevt2(tabElement, toggleElement, event) {
    tabElement.bind(event, function() {
        tabElement.removeClass("active");
        toggleElement.hide();
        var index = $(this).index();
        $(this).addClass("active");
        toggleElement.eq(index).show();
    });
};




//    不怎么会写      仿照别人的
// 轮播 
var count = 0;
var timer;
timer = setInterval(timeBottom, 1000);
$("#taobao_nbTab a").mouseenter(function() {
    clearInterval(timer);
});
$("#taobao_nbTab a").mouseleave(function() {
    clearInterval(timer);
    // count = count-1;
    timer = setInterval(timeBottom, 1000);
});

function timeBottom() {
    count++;
    if (count >= 10) {
        count = 0;
    }
    $("#taobao_nbTab a").eq(count - 1).removeClass("active");
    $("#taobao_nbTab a").eq(count).addClass("active");
    $("#taobaoImgToggle>li").eq(count - 1).hide();
    $("#taobaoImgToggle>li").eq(count).show();
}


//猜你喜欢 
var index = 0;
$("#love").click(function() {
    $(".c_list_scroll .comList").hide();
    $("#cainixihuanTabBtn").children().eq(index).removeClass("active");
    index--;
    if (index <= 0) {
        index = 0;
    }
    $("#cainixihuanTabBtn").children().eq(index).addClass("active");
    $(".c_list_scroll .comList").eq(index).show();
});
$("#cainixihuanTabRight").click(function() {
    $(".c_list_scroll .comList").hide();
    $("#cainixihuanTabBtn").children().eq(index).removeClass("active");
    index++;
    if (index >= 4) {
        index = 4;
    }
    $("#cainixihuanTabBtn").children().eq(index).addClass("active");
    $(".c_list_scroll .comList").eq(index).show();
});


